Skip to content

feat(repo-reset): force-delete verified squash-merged branches - #36

Merged
jmeridth merged 1 commit into
mainfrom
feat/repo-reset-verified-force-delete
Nov 12, 2026
Merged

jmeridth merged 1 commit into
mainfrom
feat/repo-reset-verified-force-delete

Conversation

@jmeridth

Copy link
Copy Markdown
Owner

What/Why

repo-reset now cleans up squash- and rebase-merged branches and their worktrees, which used to stay behind because git branch -d refuses them. A branch only counts as merged when a merged PR's head SHA matches its tip, and force-deletes need one [Y/n] confirmation per run.

Proof it works

I ran the same verification by hand on a large repo. 8 squash-merged branches matched their merged PR heads and were force-deleted. The bats suite didn't run because bats isn't installed locally, and it only covers reassess anyway.

Risk

Medium. The skill can now run git branch -D. The SHA match and the per-run confirmation gate it, and it never touches dirty worktrees.

AI role

Claude Opus 5.5 drafted the skill changes. Jason Meridth set the design and reviewed it.

Review focus

The ancestor case in step 3 (local tip behind the PR head) and the yes/no parsing in step 4.

## What/Why

Let repo-reset clean up squash- and rebase-merged branches and their
worktrees. Those used to get stuck because `git branch -d` refuses them
and the skill banned `-D`. A branch now counts as merged only when a
merged PR's head SHA matches its tip, not just its name, and force-deletes
need a single batched [Y/n] confirmation.

## Proof it works

- markdownlint and the pre-commit hooks pass.
- bats tests not run: bats is not installed locally (they only cover
  reassess; repo-reset has none).
- Ran the same verification by hand on a large repo: 8 squash-merged branches
  matched their merged PR heads exactly and were force-deleted cleanly.

## Risk

Medium. The skill can now run `git branch -D`. The SHA match and the
per-run confirmation gate it, and dirty worktrees are never touched.

## AI role

Claude Opus 5.5 drafted the skill changes from Jason Meridth's direction.
Jason set the design (worktrees follow their verified branch, one
confirmation prompt) and reviews the change.

## Review focus

The ancestor case in step 3 (tip behind the PR head) and the yes/no
parsing in step 4.

Signed-off-by: jmeridth <jmeridth@gmail.com>
@jmeridth jmeridth self-assigned this Nov 12, 2026
@github-actions github-actions Bot added feature release Merging this PR triggers a release labels Nov 12, 2026
@jmeridth
jmeridth marked this pull request as ready for review November 12, 2026 16:35
@jmeridth
jmeridth merged commit 5b6cb5a into main Nov 12, 2026
5 checks passed
@jmeridth
jmeridth deleted the feat/repo-reset-verified-force-delete branch November 12, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature release Merging this PR triggers a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant